<template>
  <div class="LayoutHeader">
    <div class="partLeft">
      <i
        :class="[
          isCollapse ? 'el-icon-s-unfold' : 'el-icon-s-fold',
          'asideBtn'
        ]"
        @click="asideToggle"
      ></i>
      <el-breadcrumb separator="/">
        <el-breadcrumb-item
          v-for="item in CurrentPage.breadcrumbs"
          :key="item.path"
          :to="{ path: item.path }"
          >{{ item.meta.title }}</el-breadcrumb-item
        >
        <!-- <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
        <el-breadcrumb-item><a href="/">活动管理</a></el-breadcrumb-item>
        <el-breadcrumb-item>活动列表</el-breadcrumb-item>
        <el-breadcrumb-item>活动详情</el-breadcrumb-item> -->
      </el-breadcrumb>
    </div>
    <div class="partRight">
      <!-- 全屏开关 -->
      <!-- <svg-icon
        :iconName="isFullscreen ? 'suoxiao' : 'fangda'"
        w="20px"
        h="20px"
        margin="0 20px"
        color="#CCC"
        @iconClick="pageScreenfull"
      /> -->
      <!-- pageBar 开关 -->
      <el-tooltip
        class="item"
        effect="dark"
        content="页面栏开关"
        placement="bottom-start"
      >
        <i
          :class="[pageBarShow ? 'action' : '', 'PageBarBtn', 'el-icon-guide']"
          @click="pageBarToggle"
        ></i>
      </el-tooltip>
      <!-- 用户头像 -->
      <el-dropdown style="line-height: normal" @command="userDropdown">
        <el-avatar
          shape="square"
          size="medium"
          src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"
        ></el-avatar>
        <template #dropdown>
          <el-dropdown-menu>
            <el-dropdown-item command="toHome">个人主页</el-dropdown-item>
            <el-dropdown-item command>狮子头</el-dropdown-item>
            <el-dropdown-item command>螺蛳粉</el-dropdown-item>
            <el-dropdown-item command="Logout" divided>
              <i class="el-icon-warning-outline"></i>退出
            </el-dropdown-item>
          </el-dropdown-menu>
        </template>
      </el-dropdown>
    </div>
  </div>
</template>

<script>
import { ref, computed } from "vue";
import { useStore } from "vuex";
export default {
  name: "LayoutHeader",
  props: {
    isCollapse: {
      type: Boolean
    },
    asideToggle: {
      default: () => {}
    },
    pageBarShow: {
      type: Boolean
    },
    pageBarToggle: {
      default: () => {}
    }
  },
  setup() {
    const $store = useStore();
    let { CurrentPage } = $store.state.Layout;
    const userDropdown = command => {};
    return {
      CurrentPage,
      // isFullscreen,
      // pageScreenfull,
      userDropdown
    };
  }
};
</script>

<style lang="scss" scoped>
.LayoutHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 54px;

  .partLeft {
    display: flex;
    align-items: center;
    .asideBtn {
      color: $ThemeText_grey;
      font-size: 30px;
    }
    .el-breadcrumb {
      margin-left: 15px;

      // /deep/ .el-breadcrumb__inner {
      // color: #ccc !important;
      // }
    }
  }
  .partRight {
    display: flex;
    align-items: center;
    justify-content: end;
    .PageBarBtn {
      font-size: 22px;
      margin-right: 20px;
      color: #cccccc;
      &.action {
        color: $ThemeText_grey;
      }
    }
  }
}
</style>
